Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
Error in JS "Uncaught TypeError: Cannot set properties of null (setting 'innerHTML') at call.html:10:58"

I am new to JavaScript I am trying to print an array using a function document.getElementById I am getting an error Uncaught TypeError: Cannot set properties of null (setting 'innerHTML') at call.html:10:58

<!DOCTYPE html>
<html>
    <head>
        <title>My information</title>
        <body>
            <h1>My name is Luffy</h1>
            <p>I am a software developer</p>
            <script>
            const programmingLanguage = ["Python", "Java","C"];
                document.getElementById("program").innerHTML=programmingLanguage;
            </script>
        </body>
    </head>
</html>

please help me where did i go wrong

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

The problem is that, you are trying to get an element which has the id program, but there is no element which has the id as program.

You can create an element with id program. this will resolve the error.

<!DOCTYPE html>
<html>
    <head>
        <title>My information</title>
        <body>
            <h1>My name is Luffy</h1>
            <p>I am a software developer</p>
            
            <p id="program"></p>
            
            <script>
            const programmingLanguage = ["Python", "Java","C"];
                document.getElementById("program").innerHTML=programmingLanguage;
            </script>
        </body>
    </head>
</html>

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda